<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <link href="/styles/base.css" rel="stylesheet" type="text/css">
    <link href="/styles/regist.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/js/jquery/jquery.js"></script>
    <script type="text/javascript" src="/js/plugins/jquery-form/jquery.form.js"></script>
    <script src="/js/plugins/js-cookie/js.cookie.min.js"></script>
    <script src="/js/vue/md5.js"></script>
    <script type="text/javascript" src="/js/vue/common.js"></script>
    <script type="text/javascript" src="/js/system/regist.js"></script>

</head>
<body>
<script>
    $(function (value) {

        /*//需求: 发送请求, 访问:/users/currentUser
        //返回值:

        $.get(domainUrl + "/users/currentUser",{}, function (data) {
            console.log(data);
        } );*/

        /* $.ajax({
             url: domainUrl + "/users/currentUser",
             type: "GET",
             data: {},
             beforeSend: function (xhr) {  //请求发起前
                 //xhr : 是ajax对象
                 var token = getToken();
                 //设置请求头
                 xhr.setRequestHeader("token", token);
             },
             success: function (data) {
                 console.log(data);
             }

         });*/
        //封装之后方法
        /* ajaxGet("/users/currentUser", {}, function (data) {
             console.log(data);
         });*/

        /*//测试参数解析器
         ajaxGet("/travels/getUser", {}, function (data) {
             console.log(data);
         })


         ajaxGet("/travels/updateUser", {nickname:"dafei"}, function (data) {
             console.log(data);
         })*/

        // ----------------------------------------------------------------------------------
        /*// 二次访问后端服务器时,使用js工具类"ajaxGet"发送ajax请求获取,并带上token
        ajaxGet("/users/currentUser", {}, function (data) {
            console.log(data);
        });*/
        ajaxGet("/travels/info", {}, function (data) {
            console.log(data.data);
        });
        ajaxGet("/travels/userInfo", {nickname:"dafei"}, function (data) {
            console.log(data.data);
        });

        // ----------------------------------------------------------------------------------
        // 二次访问后端服务器时,使用普通的方式发送ajax请求,并带上token
        /*$.ajax({
            url: domainUrl + "/users/currentUser",
            data: {},
            // xhr:异步请求对象
            beforeSend: function (xhr) {  //请求发起前
                //xhr : 是ajax对象
                var token = getToken();
                //设置请求头
                xhr.setRequestHeader("token", token);
            },
            success: function (data) {
                console.log(data);
            }
        });*/
    })

</script>


</body>
</html>